home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
bbs
/
cddk9606.zip
/
TUTOR.ARJ
/
TUTOR5.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-06-06
|
1KB
|
60 lines
PROGRAM Tutor5;
{$A+,B-,F+,I-,Q-,R-,S-,X+}
USES
Concerto, IO, Scripts, Types, xStrings;
{ This version is nearly identical to TUTOR4.PAS, except that the prompts
are now stored as typed constants. This allows you to easily change
them if needed. }
CONST
Prompt : pChar40 = 'And on this day, he spoke: ';
TooHigh : pChar80 = 'Your eyes are toward the heavens, esteemed one.~|';
TooLow : pChar80 = 'Your feet forever touch the earth, O Great One!~|';
Winner : pChar80 = 'You have ascended to the heavens!~|~p';
VAR
Entry : pChar3;
Number : Byte;
BEGIN
{ Setup the door }
RegisterConcerto; { Setup Concerto }
Script('Init'); { Run the initialization script }
SO_ClrScr; { Clear the screen }
Number:=Random(100)+1; { Select a random number }
REPEAT
{ The next section is described in TUTOR4.PAS }
SO_pChar(Prompt);
Entry[0]:=#0;
SI_pChar(Entry,3);
SO_CRLF; { Send a carriage-return/line-feed sequence }
{ Check the answer... }
IF p_Int(Entry)=Number THEN
BEGIN
SO_pCharLn(Winner);
ExitDoor(0);
END
ELSE
IF p_Int(Entry)>Number THEN
SO_pCharLn(TooHigh)
ELSE
SO_pCharLn(TooLow);
UNTIL False;
END.